package models

// sysContent 对应数据库表 sys_lang_item
/*
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `app_id` int(11) DEFAULT '0' COMMENT '数据归属',
*/
type SysLangItem struct {
	ID    uint   `gorm:"primaryKey;autoIncrement;comment:主键，自增ID"`
	Title string `gorm:"not null;default:'';comment:语言条目"`
	AppID int    `gorm:"default:0;comment:数据归属"`
}

type SysLangItemList struct {
	ID     uint                 `json:"id"`
	Title  string               `json:"title"`
	AppID  int                  `json:"app_id"`
	Detail []*SysLangDetailList `json:"detail"`
}

type SysLangItemCreate struct {
	Title string `json:"title"`
	AppID int    `json:"app_id"`
}

/*
LangID:   createRequest.LangID,
ItemID:   createRequest.ItemID,
Text:      createRequest.Text,
*/
type SysLangItemUpdate struct {
	ID     uint   `json:"id"`
	Title  string `json:"title"`
	LangID uint   `json:"lang_id"`
	ItemID uint   `json:"item_id"`
	Text   string `json:"text"`
	AppID  int    `json:"app_id"`
}

// TableName 设置表名为 sys_lang
func (SysLangItem) TableName() string {
	return "sys_lang_item"
}
